package com.miyake.client.datamanage.plugin;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.miyake.client.DataService;
import com.miyake.client.DataServiceAsync;
import com.miyake.client.tools.OkCancelDialog;
import com.miyake.client.tools.SmallButton;

public abstract class PluginRegisterDialog extends OkCancelDialog{
	
	protected DataServiceAsync service = DataService.Util.getInstance();
	abstract protected void addPlugin(String url);
	
	@Override
	protected Widget getContent() {
		VerticalPanel panel = new VerticalPanel();
		
		final TextBox text = new TextBox();
		SmallButton button = new SmallButton("Add", new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				addPlugin(text.getText());
			}
			
		});
		panel.add(text);
		panel.add(button);
		
		return panel;
		
	}

	
	
}
